package com.link.base.base.staticvalue.model;

import com.link.base.user.model.CoreUser;
import com.link.core.util.UserUtil;

import java.util.List;

/**
 * @author unknown
 * @date unknown
 */
public class Staticvalue {
    /**
     * 显示值,名字,二级名称,一级名称,三级名称
     */
    private String name;
    /**
     * 类型
     */
    private String type;
    /**
     * 独立源代码,独立语言代码,二级值,三级值,一级值
     */
    private String val;
    /**
     * 父值列表名
     */
    private String parentName;
    /**
     * 账套
     */
    private Long usercorpid;
    /**
     * 排序
     */
    private String seq;
    private Long id;
    /**
     * 父值列表id
     */
    private Long parentId;
    /**
     * 是否激活
     */
    private String activeFlag;
    /**add By LiQun 是否选中表示,企点产品做筛选用*/
    private boolean selectedFlag;

    /** 类型数组*/
    private List<String> types;
    /**用于mvg字段的是否主要 by lizt*/
    private String isDefault;
    /**
     * 登录人账套
     */
    private Long loginCorpId;

    public String getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(String isDefault) {
        this.isDefault = isDefault;
    }

    public List<String> getTypes() {
        return types;
    }

    public void setTypes(List<String> types) {
        this.types = types;
    }

    public boolean getSelectedFlag() {
        if (!this.selectedFlag) {
            this.selectedFlag = false;
        }
        return selectedFlag;
    }

    public void setSelectedFlag(boolean selectedFlag) {
        this.selectedFlag = selectedFlag;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getActiveFlag() {
        return activeFlag;
    }

    public void setActiveFlag(String activeFlag) {
        this.activeFlag = activeFlag;
    }

    public String getSeq() {
        return seq;
    }

    public void setSeq(String seq) {
        this.seq = seq;
    }

    public Long getUsercorpid() {
        if (usercorpid == null) {
            CoreUser user = UserUtil.getUser();
            return null == user ? null : user.getCorpid();
        } else {
            return usercorpid;
        }
    }

    public void setUsercorpid(Long usercorpid) {
        this.usercorpid = usercorpid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getVal() {
        return val;
    }

    public void setVal(String val) {
        this.val = val;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Long getLoginCorpId() {
        return loginCorpId;
    }

    public void setLoginCorpId(Long loginCorpId) {
        this.loginCorpId = loginCorpId;
    }
}
